﻿using System;
using System.IO.IsolatedStorage;

using Microsoft.Phone.Controls;

namespace Coding4Fun.SlideShow
{
    public partial class SettingsPage : PhoneApplicationPage
    {
        public SettingsPage()
        {
            InitializeComponent();

            timeSlider.Minimum = 5;
            timeSlider.Maximum = 30;

            holdSlider.Minimum = 0;
            holdSlider.Maximum = 10;

            timeSlider.Value = SettingsHelper.SlideDuration;
            holdSlider.Value = SettingsHelper.HoldDuration;
        }

        private void ApplicationBarIconButton_Click(object sender, EventArgs e)
        {
            SettingsHelper.SlideDuration = timeSlider.Value;
            SettingsHelper.HoldDuration = holdSlider.Value;
            
            if (NavigationService.CanGoBack)
                NavigationService.GoBack();
        }
    }
}